<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
		<link rel="stylesheet" href="css/bootstrap.css" />
		<link rel="stylesheet" href="css/paper_queries.css" />
		<script src="js/jquery.js"></script>
		<script src="js/bootstrap.js"></script>
		<script src="node_modules/axios/dist/axios.js"></script>
		<script src="js/register.js"></script>
	</head>
	<body>
		<div class="container" id="article_details">
			<div id="content"></div>
		</div>
	</body>
	<script>
		let admin = new Admin();
		//判断是否有权限
		admin.jurisdiction();
		function article_details() {
			axios({
				method: "get",
				url: "https://ty.php800.cn/api/article/list.php",
				params: {
					id: admin.getlocationId(),
				},
			}).then((res) => {
				console.log(res);
				Await(res);
			});
		}

		async function Await(res) {
			let { classid, title, body, userid, datetime } = res.data.blogs[0];
			let div = document.createElement("div");
			let nickname = await admin.getone(userid);
			div.innerHTML = `
			      <span class="title">${title}</span>
			<div class="qwq">
				<span id="name">${nickname[0].nickname}</span>
				<span id="time">发布时间:${admin.getdate(parseInt(datetime))}</span>
			</div>
			<div id="content">
				${body}
			</div>
			<div class="classification">
				<span></span>
			</div>
			      `;
			document.querySelector("#content").appendChild(div);
		}

		article_details();
	</script>
</html>
